package lab02.test11;

/**
 * Created by 唐苗苗 on 2017/10/25.
 */
public class Square extends Rectangle {
    double c;
    Square(double a,double b){super(a,b);}
    public double getDiahonal(){
        c=Math.sqrt(a*a+b*b);
        return c;
    }
    @Override
    public void printMyWay() {
        System.out.println("矩形的周长a="+a+"宽b="+b);
        System.out.println("面积s="+getArea());
        System.out.println("周长"+getPerimeter());
        System.out.println("对角线"+getDiahonal());
    }
}
